<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

session_start();

class Root extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		
		$this->load->helper(array('url','cookie','html','language','security','text'));
		$this->load->library(array('parser','session','user_agent','pagination','encrypt'));
		
		$uagent = do_hash($this->agent->browser());
		$platform = do_hash($this->agent->platform());
		
		if($this->agent->is_browser())
		{
			if(($this->input->cookie('dsn_agent') != $uagent) OR ($this->input->cookie('dsn_platform') != $platform))
			{
				redirect(base_url('error/uagent'));
				exit(0);
			}
		}else{
			redirect(base_url('error/uagent'));
			exit(0);
		}
		
		require_once "./lib/src/skey.php";
		
		if(($uid != 1) OR ($lvl != 1))
		{
			redirect(base_url('verify/logout'));
			exit(0);
		}
		
		function pesan($pesan, $url)
		{
			echo "
				<script type='text/javascript'>
					alert('$pesan');
					window.location.href='$url';
				</script>
				<noscript>
					<center>
						$pesan <br />
						<a href='$url'>Lanjutkan &gt;&gt;</a>
					</center>
				</noscript>
			";
		}
		
		//$this->lang->load('indonesia', 'indonesia');
		$this->load->model('Root_model','adminmodel',TRUE);	
		
	}
	   
	public function index()
	{
		$this->load->view('akar/index');
	}
	
	public function kategori()
	{
		$this->load->view('akar/kategori');
	}
	
	public function perusahaan()
	{
		$this->load->view('akar/perusahaan');
	}
	
	public function produk()
	{
		$this->load->view('akar/produk');
	}
	
	public function loker()
	{
		$this->load->view('akar/loker');
	}
	
	public function pengguna()
	{
		$this->load->view('akar/pengguna');
	}
	
	public function acara()
	{
		$this->load->view('akar/acara');
	}
	
	public function masukan()
	{
		$this->load->view('akar/masukan');
	}
	
	public function laporan()
	{
		$this->load->view('akar/laporan');
	}
	
	//public function promosi(){
		//$this->load->view('akar/promosi');
	//}
	
	
	public function edit()
	{
		$this->load->view('akar/editprofile');
	}
	
	public function scplugin()
	{
		$this->load->view('akar/scplugin');
	}
	
	
}

/* End of file root.php */
/* Location: ./application/controllers/root.php */
